<?php


namespace App\Models\MainDB;


use Illuminate\Database\Eloquent\Model;

class RoomOpLog extends Model
{
    protected $table = 'ln_room_op_log';     //数据库内完整表名

    protected $primaryKey = 'id';    //主键名


    public function opUser()
    {
        return $this->hasOne(UserData::class, 'user_id', 'op_user_id');
    }

    public function user()
    {
        return $this->hasOne(UserData::class, 'user_id', 'user_id');
    }

    public function room()
    {
        return $this->hasOne(UserRoom::class, 'id', 'room_id');
    }
}